# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-ishell
pkgname=('python2-ishell' 'python-ishell')
_pkgname=ishell
pkgver=0.1.8
pkgrel=6
pkgdesc='Build Interactive Shells with Python.'
arch=('any')
url='https://pypi.python.org/pypi/ishell/'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('9be7064ff46525daa70dc46d26f600451f4ae1d9fba083954a9620b3df93790d55f5f8d4345699df544914dbc677a7a89d897dac281a0bae9c40f0c382c26426')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-ishell() {
  depends=('python2' 'python2-future')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-ishell() {
  depends=('python' 'python-future')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

